Query LMT (Language Model Testing)
Used to query the Language Model Testing endpoint for conversational interactions with AI agents. This endpoint processes user queries and returns AI-generated responses along with follow-up suggestions.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/ai-agent/query-lmt |
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/ai-agent/query-lmt' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_key": "YOUR_PROJECT_KEY",
"query": "What are the key features of your platform?",
"session_id": "session_abc123"
}'
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"project_key": "string",
"query": "string",
"session_id": "string"
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| project_key | string | Yes | The project key for your project. |
| query | string | Yes | The user's question or message to the AI agent. |
| session_id | string | Yes | Unique identifier for the conversation session to maintain context. |
note
Session Management
- The
session_idis used to maintain conversation context across multiple queries - Use the same
session_idfor related queries in a conversation - Generate a new
session_idfor each new conversation session - The AI agent uses the session history to provide contextually relevant responses
Response
Success Response (200 OK)
Returns an object containing the AI agent's response and additional metadata.
{
"is_success": true,
"detail": "Query processed successfully",
"query": "What are the key features of your platform?",
"response": "Our platform offers several key features including: multi-language support for over 50 languages, real-time analytics and reporting, comprehensive API documentation, scalable architecture for high-volume requests, and advanced AI-powered automation capabilities. Each feature is designed to help businesses streamline their operations and improve customer engagement.",
"response_timestamp": "2026-01-11T13:24:48.085Z",
"next_step_questions": [
"Can you tell me more about the multi-language support?",
"What kind of analytics are available?",
"How does the API integration work?"
],
"session_id": "session_abc123"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the query was processed successfully. |
| detail | string | Success or failure message with additional context. |
| query | string | The original user query that was processed. |
| response | string | The AI agent's generated response to the query. |
| response_timestamp | string | ISO 8601 timestamp of when the response was generated. |
| next_step_questions | array | Array of suggested follow-up questions. |
| session_id | string | The session identifier used for this conversation. |
tip
Using Next Step Questions
The next_step_questions array contains AI-generated suggestions for follow-up queries. These can be presented to users as clickable options to:
- Guide the conversation naturally
- Help users discover relevant information
- Improve user engagement
- Reduce friction in finding answers
Error Response (422 Unprocessable Entity)
Returns validation error details when the request body is invalid.
{
"detail": [
{
"loc": [
"body",
"query"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 400 | Bad Request - Invalid query or session | Bad Request |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |
| 500 | Internal Server Error - LLM processing failed | Server Error |